package org.fast.develop.logicflow.runtime.expression;

/**
 * 项 目 名：gs-tto-data-mapping
 * 源文件名：com.geekstorm.tto.datamapping.core.expression.DelegateInvocation 文件版本：1.0.0 创建人：
 * 莫寅 创建日期：2020-07-23 11:17 修改作者：莫寅 修改日期：2020-07-23 11:17 文件描述： By：2020 © CompanyName ,
 * Inc. All Rights Reserved.
 */
public abstract class DelegateInvocation {

	protected Object invocationResult;

	protected Object[] invocationParameters;

	/**
	 * make the invocation proceed, performing the actual invocation of the user code.
	 * @throws Exception the exception thrown by the user code
	 */
	public void proceed() {
		invoke();
	}

	protected abstract void invoke();

	/**
	 * @return the result of the invocation (can be null if the invocation does not return
	 * a result)
	 */
	public Object getInvocationResult() {
		return invocationResult;
	}

	/**
	 * @return an array of invocation parameters (null if the invocation takes no
	 * parameters)
	 */
	public Object[] getInvocationParameters() {
		return invocationParameters;
	}

	/**
	 * returns the target of the current invocation, ie. JavaDelegate, ValueExpression ...
	 */
	public abstract Object getTarget();

}
